package org.example.component;

import dev.langchain4j.memory.ChatMemory;
import dev.langchain4j.memory.chat.MessageWindowChatMemory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ComponentConfig 
{
	@Bean
	public ChatMemory chatMemory()
	{
		return MessageWindowChatMemory.builder()
				.maxMessages(5)	//最大消息记忆存储
				.build();	//构建
	}
}
